home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacTech 1 to 12
/
MacTech-vol-1-12.toast
/
Tools
/
Alpha 6.51b13 ƒ
/
Tcl
/
SystemCode
/
paths.tcl
< prev
next >
Wrap
Text File
|
1996-08-15
|
2KB
|
64 lines
if {$alphaLite} return
# Any directory must have 'folder' somewhere in the comment.
set pathComments(TeXInputs) "TeX Inputs folder"
set pathComments(eudoraNicknames) "Eudora Nickname File"
set pathComments(perlFilterPath) "MacPerl Text Filters folder"
set pathComments(perlDocs) "MacPerl documentation folder"
set pathComments(perlLib) "MacPerl lib folder"
# set pathComments(cIncludePath) "C include path"
set cIncludePath ""
set tmp {}
foreach n [array names pathComments] {
lappend tmp $pathComments($n)
}
menu -n appPaths -m -p pathProc [lsort $tmp]
unset tmp
#===============================================================================
proc pathProc {menu comment} {
global pathComments modifiedVars pathSig pathUseIC
foreach path [array names pathComments] {
if {$pathComments($path) == $comment} {
global $path
if {[info exists $path]} {
set buttons {OK Change Remove}
if {[info exists pathUseIC($path)]} {
lappend buttons "IConfig"
}
set val [set $path]
} else {
set buttons {OK Set Remove}
set val {}
}
set res [eval [list buttonAlert "$pathComments($path):\r$val"] $buttons]
switch $res {
"Set" "-"
"Change" { if {[regexp -nocase {.*folder.*} $pathComments($path)]} {
set $path [get_directory -p "Select $pathComments($path):"]
} else {
set $path [getfile "Select $pathComments($path):"]
}
lappend modifiedVars $path
if {[info exists pathSig($path)]} {
global $pathSig($path)
set $pathSig($path) [getFileSig [set $path]]
lappend modifiedVars $pathSig($path)
}
}
"Remove" { set $path {} }
}
return
}
}
}